package com.rois.librois.RoIS;


/**
* RoIS/_ComponentBaseStub.java .
* IDL-to-Java コンパイラ (ポータブル), バージョン "3.1" で生成
* 生成元: RoIS_IDL.idl
* 2011年9月8日 0時05分18秒 JST
*/


/*********************************************
 For Engine-Component Connection (Component-side)
**********************************************/
public class _ComponentBaseStub extends org.omg.CORBA.portable.ObjectImpl implements com.rois.librois.RoIS.ComponentBase
{


  /* For System Interface */
  public com.rois.librois.RoIS.ReturnCode_t get_profile (String condition, com.rois.librois.RoIS.ComponentProfileHolder profile)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_profile", true);
                com.rois.librois.RoIS.Condition_tHelper.write ($out, condition);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                profile.value = com.rois.librois.RoIS.ComponentProfileHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_profile (condition, profile        );
            } finally {
                _releaseReply ($in);
            }
  } // get_profile

  public com.rois.librois.RoIS.ReturnCode_t get_error_detail (String error_id, String condition, com.rois.librois.RoIS.ResultListHolder results)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_error_detail", true);
                $out.write_string (error_id);
                com.rois.librois.RoIS.Condition_tHelper.write ($out, condition);
                com.rois.librois.RoIS.ResultListHelper.write ($out, results.value);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                results.value = com.rois.librois.RoIS.ResultListHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_error_detail (error_id, condition, results        );
            } finally {
                _releaseReply ($in);
            }
  } // get_error_detail


  /* For Command Interface */
  public com.rois.librois.RoIS.ReturnCode_t bind (String servername)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("bind", true);
                $out.write_string (servername);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return bind (servername        );
            } finally {
                _releaseReply ($in);
            }
  } // bind

  public com.rois.librois.RoIS.ReturnCode_t release (String servername)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("release", true);
                $out.write_string (servername);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return release (servername        );
            } finally {
                _releaseReply ($in);
            }
  } // release

  public com.rois.librois.RoIS.ReturnCode_t get_parameter (com.rois.librois.RoIS.ParameterListHolder parameters)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_parameter", true);
                com.rois.librois.RoIS.ParameterListHelper.write ($out, parameters.value);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                parameters.value = com.rois.librois.RoIS.ParameterListHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_parameter (parameters        );
            } finally {
                _releaseReply ($in);
            }
  } // get_parameter

  public com.rois.librois.RoIS.ReturnCode_t set_parameter (String servername, com.rois.librois.RoIS.Parameter[] parameters, org.omg.CORBA.StringHolder command_id)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("set_parameter", true);
                $out.write_string (servername);
                com.rois.librois.RoIS.ParameterListHelper.write ($out, parameters);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                command_id.value = $in.read_string ();
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return set_parameter (servername, parameters, command_id        );
            } finally {
                _releaseReply ($in);
            }
  } // set_parameter

  public com.rois.librois.RoIS.ReturnCode_t execute (String servername, String command_type, com.rois.librois.RoIS.Argument[] arguments, org.omg.CORBA.StringHolder command_id)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("execute", true);
                $out.write_string (servername);
                $out.write_string (command_type);
                com.rois.librois.RoIS.ArgumentListHelper.write ($out, arguments);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                command_id.value = $in.read_string ();
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return execute (servername, command_type, arguments, command_id        );
            } finally {
                _releaseReply ($in);
            }
  } // execute

  public com.rois.librois.RoIS.ReturnCode_t get_command_result (String servername, String command_id, String condition, com.rois.librois.RoIS.ResultListHolder results)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_command_result", true);
                $out.write_string (servername);
                $out.write_string (command_id);
                com.rois.librois.RoIS.Condition_tHelper.write ($out, condition);
                com.rois.librois.RoIS.ResultListHelper.write ($out, results.value);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                results.value = com.rois.librois.RoIS.ResultListHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_command_result (servername, command_id, condition, results        );
            } finally {
                _releaseReply ($in);
            }
  } // get_command_result


  /* For Query Interface */
  public com.rois.librois.RoIS.ReturnCode_t query (String query_type, String condition, com.rois.librois.RoIS.ResultListHolder results)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("query", true);
                $out.write_string (query_type);
                com.rois.librois.RoIS.Condition_tHelper.write ($out, condition);
                com.rois.librois.RoIS.ResultListHelper.write ($out, results.value);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                results.value = com.rois.librois.RoIS.ResultListHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return query (query_type, condition, results        );
            } finally {
                _releaseReply ($in);
            }
  } // query


  /* For Event Interface */
  public com.rois.librois.RoIS.ReturnCode_t subscribe (String servername, String event_type, String condition, org.omg.CORBA.StringHolder subscribe_id)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("subscribe", true);
                $out.write_string (servername);
                $out.write_string (event_type);
                com.rois.librois.RoIS.Condition_tHelper.write ($out, condition);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                subscribe_id.value = $in.read_string ();
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return subscribe (servername, event_type, condition, subscribe_id        );
            } finally {
                _releaseReply ($in);
            }
  } // subscribe

  public com.rois.librois.RoIS.ReturnCode_t unsubscribe (String servername, String subscribe_id)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("unsubscribe", true);
                $out.write_string (servername);
                $out.write_string (subscribe_id);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return unsubscribe (servername, subscribe_id        );
            } finally {
                _releaseReply ($in);
            }
  } // unsubscribe

  public com.rois.librois.RoIS.ReturnCode_t get_event_detail (String servername, String event_id, String condition, com.rois.librois.RoIS.ResultListHolder results)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_event_detail", true);
                $out.write_string (servername);
                $out.write_string (event_id);
                com.rois.librois.RoIS.Condition_tHelper.write ($out, condition);
                com.rois.librois.RoIS.ResultListHelper.write ($out, results.value);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                results.value = com.rois.librois.RoIS.ResultListHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_event_detail (servername, event_id, condition, results        );
            } finally {
                _releaseReply ($in);
            }
  } // get_event_detail

  // Type-specific CORBA::Object operations
  private static String[] __ids = {
    "IDL:RoIS/ComponentBase:1.0"};

  public String[] _ids ()
  {
    return (String[])__ids.clone ();
  }

  private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  {
     String str = s.readUTF ();
     String[] args = null;
     java.util.Properties props = null;
     org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
   try {
     org.omg.CORBA.Object obj = orb.string_to_object (str);
     org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
     _set_delegate (delegate);
   } finally {
     orb.destroy() ;
   }
  }

  private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  {
     String[] args = null;
     java.util.Properties props = null;
     org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
   try {
     String str = orb.object_to_string (this);
     s.writeUTF (str);
   } finally {
     orb.destroy() ;
   }
  }
} // class _ComponentBaseStub
